package com.gzx.spring.apis.tests.huarong;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.gzx.risk.core.apis.context.ApiContext;
import com.gzx.risk.core.apis.result.RiskResult;
import com.gzx.risk.core.apis.result.huarong.HuarongR9003;
import com.gzx.spring.apis.service.ApiExec;
import com.gzx.spring.apis.service.HuarongService;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class R9003Demo{
    private static String privateKeyBase64 = "MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBALlx4dNHzk4Jub" +
            "Ayg8hikI9T8pXJ75HQ4uR58qub/a7PuXXrKRB2MbbAuhpC3oJotLTGMm3TvyKFIL9tnItMqOpG3cK4jR977i5DFi+DJUFBH" +
            "IIvIZqsLmioUxej8bHobtdcTGf2GWR9kChiCSvltUczOM7Yzkz6gkwcbA3i7ksPAgMBAAECgYAE4Y99HS279huSHLJFSvrd" +
            "GuuOr8MDhokCVIdjpvZ1bHhIN0lcapACbG45lLsAmbrv6yuWonUsdm6XO05ciEcF4A1kd4if830RG1emeAMsulHTK3PrRqD" +
            "+H175DzbJsdACCUFqyt0P5DYN5ZleUXF1/x0faoBXyVURdy8R6hYoiQJBAPTG8LP9uL1DzqeANrqK7OEf7pe5clpauyx5a+" +
            "yP9WupO4WrWyzfHz+ixs2Oh4q1wEHgN145j5/4Y6rie+VErzMCQQDB8ohFZl6QzjMGeVuGBYRik26+3qAmc9grsm2BrnnDm" +
            "wnqmLtrAvOUArxOsGCP3QgecZf61uLM1S4CJ0+hV+S1AkA0xWMFWvDmFOVLpU+nPeY9zrWQjlGB+0eZGgBTeuHNOSn08nFw" +
            "phXFkWFM1aqRFAgD68PkE4LMWS+bmsJdNkaTAkEAhdZA9Ws8LL8udPRAFU8vWPsWfD6S05YzgYwCh3AIdNRDVpGJG8KQpf3" +
            "xRnfuWriTxrZqw12QavtdYX0RNWy61QJAYzVizCubHZDIDH/akxUn6RyDtGFuepIUn62jyDLQPilR/LUtD7Rv10XrsPSf4B" +
            "sCQKvz1ZCvEMDIMUZxC/Y06A==";// rsa私钥
    private static String publicKeyBase64 = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC5ceHTR85OCbmwMoPIYpCPU/K" +
            "Vye+R0OLkefKrm/2uz7l16ykQdjG2wLoaQt6CaLS0xjJt078ihSC/bZyLTKjqRt3CuI0fe+4uQxYvgyVBQRyCLyGarC5oqF" +
            "MXo/Gx6G7XXExn9hlkfZAoYgkr5bVHMzjO2M5M+oJMHGwN4u5LDwIDAQAB";// rsa公钥
    private static String desKey = "12345678";// des盐key
    private static String md5Key = "6y5kbbwfzfd6iygvoei5";// mk5key
    private static String post_url_base = "https://test.xinghuarong.com/api/v1.1";// 征信查询请求地址
    private static String merchantId = "100000205";// 机构编号
    private static ObjectMapper objectMapper = new ObjectMapper();

    public static void main(String[] args) throws Exception {
//        System.out.println(testGetValue("rules_F001_F001A_A21"));
        testGetValueByPath();
//        HuarongService huarongService = new HuarongService();
//        ApiContext ctx = new ApiContext();
//        RiskResult riskResult = huarongService.R9003("17", ctx);
    }

    private static String testGetValue(String path) throws Exception {
        String json = ApiExec.loadJson("/debug/huarong/R9003");
        HuarongR9003 obj = objectMapper.readValue(json, HuarongR9003.class);
        return obj.getValueByPath(path);
    }

    private static void testGetValueByPath() throws Exception {
        Double a = 20.0;
        Double b = 30.0;
        System.out.println(a==0.0);
    }
}
